<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

/**
 * 前台路由
 */
Route::group(['namespace'=>'Home'],function(){
    Route::get('/', 'IndexController@index');
});

/**
 * 后台路由
 */
Route::group(['namespace' => 'Admin'],function(){
    Route::get('admin','IndexController@index');
    Route::get('/skin-config', 'IndexController@skinConfig');
    //商品路由
    Route::get('admin/goods-list','GoodsController@index');
    Route::get('admin/goods-add','GoodsController@add');
    Route::post('admin/goods-addRes','GoodsController@addRes');
    Route::get('admin/goods-update/{id}','GoodsController@update');
    Route::post('admin/goods-updateRes','GoodsController@updateRes');
    Route::get('admin/goods-delete','GoodsController@delete');
    Route::get('admin/changeGoodsStatus','GoodsController@changeStatus');

    //分类路由
    Route::get('admin/cate-list','CateController@index');
    Route::get('admin/cate-add','CateController@add');
    Route::post('admin/cate-addRes','CateController@addRes');
    Route::get('admin/cate-update/{id}','CateController@update');
    Route::post('admin/cate-updateRes','CateController@updateRes');
    Route::get('admin/cate-delete','CateController@delete');

    //用户路由
    Route::get('admin/user-list','UserController@index');

    //评论路由
    Route::get('admin/comment-list','CommentController@index');
    Route::get('admin/comment-reply','CommentController@reply');
    Route::get('admin/changeCommentStatus','CommentController@changeCommentStatus');

    //轮播图路由
    Route::get('admin/carousel-list','CarouselController@index');
    Route::get('admin/carousel-sort','CarouselController@sort');
    Route::get('admin/carousel-delete','CarouselController@delete');
    Route::get('admin/carousel-add','CarouselController@add');
    Route::post('admin/carousel-addRes','CarouselController@addRes');
    
    //订单路由
    Route::get('admin/orders-list','OrdersController@index');
    Route::get('admin/orders-detail/{id}','OrdersController@detail');

    //淘宝资讯
    Route::get('admin/advice-list','AdviceController@index');
    Route::get('admin/advice-add','AdviceController@add');
    Route::post('admin/advice-addRes','AdviceController@addRes');
    Route::get('admin/advice-update/{id}','AdviceController@update');
    Route::post('admin/advice-updateRes','AdviceController@updateRes');
    Route::get('admin/advice-delete','AdviceController@delete');


});

/**
 * 小程序路由
 */
Route::group(['namespace' => 'Home'],function(){
    Route::any('/wechat','WechatController@index');
});

/**
 * 小程序接口
 */
Route::group(['namespace' => 'Api'],function(){
    Route::get('/api/index','IndexController@index');
    
    //用户路由
    Route::get('/api/user/getSessionKey','UserController@getSessionKey');
    Route::get('/api/user/authLogin','UserController@authLogin');
});
